import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int x1 = scan.nextInt();
        int y1 = scan.nextInt();
        int x2 = scan.nextInt();
        int y2 = scan.nextInt();
        int x3 = scan.nextInt();
        int y3 = scan.nextInt();
        int x4 = scan.nextInt();
        int y4 = scan.nextInt();
        if (x3 >= x1 && y3 >= y1 && x4 <= x2 && y4 <= y2) {
            System.out.println(Math.abs(x2 - x1) * Math.abs(y2 - y1));
        } else if (x3 <= x1 && y3 <= y1 && x4 >= x2 && y4 >= y2) {
            System.out.println(Math.abs(x4 - x3) * Math.abs(y4 - y3));
        } else {
            System.out.println(Math.abs(x2 - x1) * Math.abs(y2 - y1) + Math.abs(x3 - x4) * Math.abs(y3 - y4));
        }
        scan.close();
    }
}
